<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FabGL: soundgen.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">FabGL
   </div>
   <div id="projectbrief">ESP32 Display Controller and Graphics Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('soundgen_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle"><div class="title">soundgen.h</div></div>
</div><!--header-->
<div class="contents">
<a href="soundgen_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment">  Created by Fabrizio Di Vittorio (fdivitto2013@gmail.com) - &lt;http://www.fabgl.com&gt;</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment">  Copyright (c) 2019-2022 Fabrizio Di Vittorio.</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment">  All rights reserved.</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"></span> </div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="comment"></span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="comment">* Please contact fdivitto2013@gmail.com if you need a commercial license.</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="comment"></span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="comment"></span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="comment">* This library and related software is available under GPL v3.</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="comment"></span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="comment">  FabGL is free software: you can redistribute it and/or modify</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="comment">  it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="comment">  the Free Software Foundation, either version 3 of the License, or</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="comment">  (at your option) any later version.</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="comment"></span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="comment">  FabGL is distributed in the hope that it will be useful,</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="comment">  but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="comment">  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="comment">  GNU General Public License for more details.</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="comment"></span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="comment">  You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="comment">  along with FabGL.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="comment"> */</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span> </div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span><span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span><span class="preprocessor">#include &lt;stddef.h&gt;</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span> </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span><span class="preprocessor">#include &quot;freertos/FreeRTOS.h&quot;</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span> </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span><span class="preprocessor">#if __has_include(&quot;esp32/rom/lldesc.h&quot;</span>)</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span><span class="preprocessor">  #include &quot;esp32/rom/lldesc.h&quot;</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span><span class="preprocessor">  #include &quot;rom/lldesc.h&quot;</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span><span class="preprocessor">#include &quot;soc/i2s_struct.h&quot;</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span><span class="preprocessor">#include &quot;soc/sens_struct.h&quot;</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span><span class="preprocessor">#include &quot;esp_timer.h&quot;</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span> </div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span><span class="preprocessor">#include &quot;<a class="code" href="fabglconf_8h.html">fabglconf.h</a>&quot;</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span><span class="preprocessor">#include &quot;<a class="code" href="fabutils_8h.html">fabutils.h</a>&quot;</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span> </div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span> </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span><span class="keyword">namespace </span>fabgl {</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span><span class="preprocessor">#define FABGL_SOUNDGEN_DEFAULT_SAMPLE_RATE 16384</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span> </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span> </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span><span class="comment">// DAC mode specific:</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span><span class="comment">// setting 64 at 16KHz, generates 16000/64=250 interrupts per second</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span><span class="preprocessor">#define FABGL_SOUNDGEN_SAMPLE_BUFFER_SIZE 64</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span> </div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator.html">   71</a></span><span class="keyword">class </span><a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>  <a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a>() : next(<span class="keyword">nullptr</span>), m_sampleRate(0), m_volume(100), m_enabled(<span class="keyword">false</span>), m_duration(-1), m_autoDestroy(<span class="keyword">false</span>), m_autoDetach(<span class="keyword">false</span>) { }</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span> </div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span>  <span class="keyword">virtual</span> <a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">~WaveformGenerator</a>() { }</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span> </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_a6d3ded07c8e0000d3f20c12ed801db7b.html#a6d3ded07c8e0000d3f20c12ed801db7b">   82</a></span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_waveform_generator_a6d3ded07c8e0000d3f20c12ed801db7b.html#a6d3ded07c8e0000d3f20c12ed801db7b">setFrequency</a>(<span class="keywordtype">int</span> value) = 0;</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span> </div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_aae62a0a75472fde81f63cd0f9d9288c2.html#aae62a0a75472fde81f63cd0f9d9288c2">   89</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_waveform_generator_aae62a0a75472fde81f63cd0f9d9288c2.html#aae62a0a75472fde81f63cd0f9d9288c2">setDuration</a>(uint32_t value) { m_duration = value; }</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span> </div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_a996f2f6c960641738fc46d3f39f6ef6f.html#a996f2f6c960641738fc46d3f39f6ef6f">   96</a></span>  uint32_t <a class="code hl_function" href="classfabgl_1_1_waveform_generator_a996f2f6c960641738fc46d3f39f6ef6f.html#a996f2f6c960641738fc46d3f39f6ef6f">duration</a>() { <span class="keywordflow">return</span> m_duration; }</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span> </div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_ace43e846a26854aa34091e3eabd07f24.html#ace43e846a26854aa34091e3eabd07f24">  103</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_waveform_generator_ace43e846a26854aa34091e3eabd07f24.html#ace43e846a26854aa34091e3eabd07f24">setAutoDetach</a>(<span class="keywordtype">bool</span> value) { m_autoDetach = value; }</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span> </div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span>  <span class="keywordtype">bool</span> autoDetach() { <span class="keywordflow">return</span> m_autoDetach; }</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span> </div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_a2670d55a6f6725717133799223effc61.html#a2670d55a6f6725717133799223effc61">  112</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_waveform_generator_a2670d55a6f6725717133799223effc61.html#a2670d55a6f6725717133799223effc61">setAutoDestroy</a>(<span class="keywordtype">bool</span> value) { m_autoDestroy = value; m_autoDetach |= value; }</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span> </div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span>  <span class="keywordtype">bool</span> autoDestroy() { <span class="keywordflow">return</span> m_autoDestroy; }</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span> </div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_af6efc18f13f1cd2aeb2fb810b103b356.html#af6efc18f13f1cd2aeb2fb810b103b356">  121</a></span>  <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code hl_function" href="classfabgl_1_1_waveform_generator_af6efc18f13f1cd2aeb2fb810b103b356.html#af6efc18f13f1cd2aeb2fb810b103b356">getSample</a>() = 0;</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span> </div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_a77a669d4f95b8abf529a7d3183acb432.html#a77a669d4f95b8abf529a7d3183acb432">  128</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_waveform_generator_a77a669d4f95b8abf529a7d3183acb432.html#a77a669d4f95b8abf529a7d3183acb432">setVolume</a>(<span class="keywordtype">int</span> value) { m_volume = value; }</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span> </div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">  135</a></span>  <span class="keywordtype">int</span> <a class="code hl_function" href="classfabgl_1_1_waveform_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">volume</a>() { <span class="keywordflow">return</span> m_volume; }</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span> </div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_acafb7271189f6d844921794d61cd608a.html#acafb7271189f6d844921794d61cd608a">  142</a></span>  <span class="keywordtype">bool</span> <a class="code hl_function" href="classfabgl_1_1_waveform_generator_acafb7271189f6d844921794d61cd608a.html#acafb7271189f6d844921794d61cd608a">enabled</a>() { <span class="keywordflow">return</span> m_enabled; }</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span> </div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_a4d003299b7939c5c2a6fd8cee4fe7504.html#a4d003299b7939c5c2a6fd8cee4fe7504">  151</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_waveform_generator_a4d003299b7939c5c2a6fd8cee4fe7504.html#a4d003299b7939c5c2a6fd8cee4fe7504">enable</a>(<span class="keywordtype">bool</span> value) { m_enabled = value; }</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span> </div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_a85fa2eb2cf3e487be53c8b2625bdce69.html#a85fa2eb2cf3e487be53c8b2625bdce69">  160</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_waveform_generator_a85fa2eb2cf3e487be53c8b2625bdce69.html#a85fa2eb2cf3e487be53c8b2625bdce69">setSampleRate</a>(<span class="keywordtype">int</span> value) { m_sampleRate = value; }</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span> </div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"><a class="line" href="classfabgl_1_1_waveform_generator_abc395029362d9990b5dad44dfafe9d63.html#abc395029362d9990b5dad44dfafe9d63">  167</a></span>  uint16_t <a class="code hl_function" href="classfabgl_1_1_waveform_generator_abc395029362d9990b5dad44dfafe9d63.html#abc395029362d9990b5dad44dfafe9d63">sampleRate</a>() { <span class="keywordflow">return</span> m_sampleRate; }</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span> </div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span>  <a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> * next;</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span> </div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span><span class="keyword">protected</span>:</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span> </div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span>  <span class="keywordtype">void</span> decDuration() { --m_duration; <span class="keywordflow">if</span> (m_duration == 0) m_enabled = <span class="keyword">false</span>; }</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span> </div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span>  uint16_t m_sampleRate;</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span>  int8_t   m_volume;</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span>  int8_t   m_enabled;   <span class="comment">// 0 = disabled, 1 = enabled</span></div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span>  uint32_t m_duration;  <span class="comment">// number of samples to play (-1 = infinite)</span></div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno">  180</span>  <span class="keywordtype">bool</span>     m_autoDestroy; <span class="comment">// if true: this object needs to be destroyed by the sound generator when there are no more samples to play</span></div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>  <span class="keywordtype">bool</span>     m_autoDetach;  <span class="comment">// if true: this object needs to be autodetached from the sound generator when there are no more samples to play</span></div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span>};</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span> </div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span> </div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sine_waveform_generator.html">  186</a></span><span class="keyword">class </span><a class="code hl_class" href="classfabgl_1_1_sine_waveform_generator.html">SineWaveformGenerator</a> : <span class="keyword">public</span> <a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno">  188</span>  <a class="code hl_class" href="classfabgl_1_1_sine_waveform_generator.html">SineWaveformGenerator</a>();</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span> </div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_sine_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span> </div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span>  <span class="keywordtype">int</span> <a class="code hl_function" href="classfabgl_1_1_sine_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span> </div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span>  uint32_t m_phaseInc;</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span>  uint32_t m_phaseAcc;</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno">  197</span>  uint16_t m_frequency;</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno">  198</span>  int16_t  m_lastSample;</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno">  199</span>};</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno">  200</span> </div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno">  201</span> </div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"><a class="line" href="classfabgl_1_1_square_waveform_generator.html">  203</a></span><span class="keyword">class </span><a class="code hl_class" href="classfabgl_1_1_square_waveform_generator.html">SquareWaveformGenerator</a> : <span class="keyword">public</span> <a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno">  204</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno">  205</span>  <a class="code hl_class" href="classfabgl_1_1_square_waveform_generator.html">SquareWaveformGenerator</a>();</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span> </div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno">  207</span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_square_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno">  208</span> </div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_square_waveform_generator_a5719e6bf55f3f485e6b82e7800acf004.html#a5719e6bf55f3f485e6b82e7800acf004">setDutyCycle</a>(<span class="keywordtype">int</span> dutyCycle);</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno">  215</span> </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span>  <span class="keywordtype">int</span> <a class="code hl_function" href="classfabgl_1_1_square_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span> </div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span>  uint32_t m_phaseInc;</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span>  uint32_t m_phaseAcc;</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span>  uint16_t m_frequency;</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span>  int8_t   m_lastSample;</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno">  223</span>  uint8_t  m_dutyCycle;</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno">  224</span>};</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno">  225</span> </div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno">  226</span> </div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"><a class="line" href="classfabgl_1_1_triangle_waveform_generator.html">  228</a></span><span class="keyword">class </span><a class="code hl_class" href="classfabgl_1_1_triangle_waveform_generator.html">TriangleWaveformGenerator</a> : <span class="keyword">public</span> <a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span>  <a class="code hl_class" href="classfabgl_1_1_triangle_waveform_generator.html">TriangleWaveformGenerator</a>();</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span> </div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_triangle_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno">  233</span> </div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno">  234</span>  <span class="keywordtype">int</span> <a class="code hl_function" href="classfabgl_1_1_triangle_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno">  235</span> </div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno">  236</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno">  237</span>  uint32_t m_phaseInc;</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno">  238</span>  uint32_t m_phaseAcc;</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno">  239</span>  uint16_t m_frequency;</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno">  240</span>  int8_t   m_lastSample;</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno">  241</span>};</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno">  242</span> </div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno">  243</span> </div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sawtooth_waveform_generator.html">  245</a></span><span class="keyword">class </span><a class="code hl_class" href="classfabgl_1_1_sawtooth_waveform_generator.html">SawtoothWaveformGenerator</a> : <span class="keyword">public</span> <a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno">  246</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno">  247</span>  <a class="code hl_class" href="classfabgl_1_1_sawtooth_waveform_generator.html">SawtoothWaveformGenerator</a>();</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno">  248</span> </div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno">  249</span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_sawtooth_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno">  250</span> </div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno">  251</span>  <span class="keywordtype">int</span> <a class="code hl_function" href="classfabgl_1_1_sawtooth_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno">  252</span> </div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno">  254</span>  uint32_t m_phaseInc;</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno">  255</span>  uint32_t m_phaseAcc;</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno">  256</span>  uint16_t m_frequency;</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno">  257</span>  int8_t   m_lastSample;</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno">  258</span>};</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno">  259</span> </div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno">  260</span> </div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"><a class="line" href="classfabgl_1_1_noise_waveform_generator.html">  262</a></span><span class="keyword">class </span><a class="code hl_class" href="classfabgl_1_1_noise_waveform_generator.html">NoiseWaveformGenerator</a> : <span class="keyword">public</span> <a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno">  263</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno">  264</span>  <a class="code hl_class" href="classfabgl_1_1_noise_waveform_generator.html">NoiseWaveformGenerator</a>();</div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno">  265</span> </div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno">  266</span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_noise_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno">  267</span> </div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno">  268</span>  <span class="keywordtype">int</span> <a class="code hl_function" href="classfabgl_1_1_noise_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno">  269</span> </div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno">  270</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno">  271</span>  uint16_t m_noise;</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno">  272</span>};</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno">  273</span> </div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno">  274</span> </div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno">  276</span><span class="comment">// &quot;tries&quot; to emulate VIC6561 noise generator</span></div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno">  277</span><span class="comment">// derived from a reverse enginnered VHDL code: http://www.denial.shamani.dk/bb/viewtopic.php?t=8733&amp;start=210</span></div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno">  278</span> </div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"><a class="line" href="classfabgl_1_1_v_i_c_noise_generator.html">  284</a></span><span class="keyword">class </span><a class="code hl_class" href="classfabgl_1_1_v_i_c_noise_generator.html">VICNoiseGenerator</a> : <span class="keyword">public</span> <a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno">  285</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno">  286</span>  <a class="code hl_class" href="classfabgl_1_1_v_i_c_noise_generator.html">VICNoiseGenerator</a>();</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno">  287</span> </div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno">  288</span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_v_i_c_noise_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno">  289</span>  uint16_t frequency() { <span class="keywordflow">return</span> m_frequency; }</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno">  290</span> </div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno">  291</span>  <span class="keywordtype">int</span> <a class="code hl_function" href="classfabgl_1_1_v_i_c_noise_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno">  292</span> </div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno">  293</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno">  294</span>  <span class="keyword">static</span> <span class="keyword">const</span> uint16_t LFSRINIT = 0x0202;</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno">  295</span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span>      CLK      = 4433618;</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno">  296</span> </div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno">  297</span>  uint16_t m_frequency;</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno">  298</span>  uint16_t m_counter;</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno">  299</span>  uint16_t m_LFSR;</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno">  300</span>  uint16_t m_outSR;</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno">  301</span>};</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno">  302</span> </div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno">  303</span> </div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno">  304</span> </div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"><a class="line" href="classfabgl_1_1_samples_generator.html">  311</a></span><span class="keyword">class </span><a class="code hl_class" href="classfabgl_1_1_samples_generator.html">SamplesGenerator</a> : <span class="keyword">public</span> <a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> {</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno">  312</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno">  313</span>  <a class="code hl_class" href="classfabgl_1_1_samples_generator.html">SamplesGenerator</a>(int8_t <span class="keyword">const</span> * <a class="code hl_variable" href="displaycontroller_8h_a96db82e580e46e24e2b39dd6c5bf7c21.html#a96db82e580e46e24e2b39dd6c5bf7c21">data</a>, <span class="keywordtype">int</span> length);</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno">  314</span> </div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno">  315</span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_samples_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">setFrequency</a>(<span class="keywordtype">int</span> value);</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno">  316</span> </div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno">  317</span>  <span class="keywordtype">int</span> <a class="code hl_function" href="classfabgl_1_1_samples_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">getSample</a>();</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno">  318</span> </div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno">  319</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno">  320</span>  int8_t <span class="keyword">const</span> * m_data;</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno">  321</span>  <span class="keywordtype">int</span>            m_length;</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno">  322</span>  <span class="keywordtype">int</span>            m_index;</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno">  323</span>};</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno">  324</span> </div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno">  325</span> </div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"><a class="line" href="group___enumerations_ga0c57da098cf653e49e8c46e3a86eee31.html#ga0c57da098cf653e49e8c46e3a86eee31">  329</a></span><span class="keyword">enum class</span> <a class="code hl_enumeration" href="group___enumerations_ga0c57da098cf653e49e8c46e3a86eee31.html#ga0c57da098cf653e49e8c46e3a86eee31">SoundGenMethod</a> {</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno">  330</span>  <a class="code hl_enumvalue" href="group___enumerations_ga0c57da098cf653e49e8c46e3a86eee31.html#gga0c57da098cf653e49e8c46e3a86eee31a52a8b954485e8bf8ebe32865d17563a6">DAC</a>,             </div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno">  331</span>  <a class="code hl_enumvalue" href="group___enumerations_ga0c57da098cf653e49e8c46e3a86eee31.html#gga0c57da098cf653e49e8c46e3a86eee31a582cc73bac6fd333fd602b6a3db1dfd4">SigmaDelta</a>,      </div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno">  332</span>  <a class="code hl_enumvalue" href="group___enumerations_ga0c57da098cf653e49e8c46e3a86eee31.html#gga0c57da098cf653e49e8c46e3a86eee31a06b9281e396db002010bde1de57262eb">Auto</a>,            </div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno">  333</span>};</div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno">  334</span> </div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno">  335</span> </div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sound_generator.html">  351</a></span><span class="keyword">class </span><a class="code hl_class" href="classfabgl_1_1_sound_generator.html">SoundGenerator</a> {</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno">  352</span> </div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno">  353</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno">  354</span> </div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno">  373</span>  <a class="code hl_function" href="classfabgl_1_1_sound_generator_a1f313ace9bd328af72dac21f508f7b25.html#a1f313ace9bd328af72dac21f508f7b25">SoundGenerator</a>(<span class="keywordtype">int</span> sampleRate = FABGL_SOUNDGEN_DEFAULT_SAMPLE_RATE, gpio_num_t gpio = GPIO_AUTO, <a class="code hl_enumeration" href="group___enumerations_ga0c57da098cf653e49e8c46e3a86eee31.html#ga0c57da098cf653e49e8c46e3a86eee31">SoundGenMethod</a> genMethod = <a class="code hl_enumvalue" href="group___enumerations_ga0c57da098cf653e49e8c46e3a86eee31.html#gga0c57da098cf653e49e8c46e3a86eee31a06b9281e396db002010bde1de57262eb">SoundGenMethod::Auto</a>);</div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno">  374</span> </div>
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno">  375</span>  <a class="code hl_class" href="classfabgl_1_1_sound_generator.html">~SoundGenerator</a>();</div>
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno">  376</span> </div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno">  380</span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_sound_generator_ac8bb3912a3ce86b15842e79d0b421204.html#ac8bb3912a3ce86b15842e79d0b421204">clear</a>();</div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno">  381</span> </div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno">  393</span>  <span class="keywordtype">bool</span> <a class="code hl_function" href="classfabgl_1_1_sound_generator_aa7c56b84cb4738b6826e34ca20993d62.html#aa7c56b84cb4738b6826e34ca20993d62">play</a>(<span class="keywordtype">bool</span> value);</div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno">  394</span> </div>
<div class="line"><a id="l00408" name="l00408"></a><span class="lineno">  408</span>  <a class="code hl_class" href="classfabgl_1_1_samples_generator.html">SamplesGenerator</a> * <a class="code hl_function" href="classfabgl_1_1_sound_generator_a7ba0033bdfb41d5d58fc63a160f311f6.html#a7ba0033bdfb41d5d58fc63a160f311f6">playSamples</a>(int8_t <span class="keyword">const</span> * <a class="code hl_variable" href="displaycontroller_8h_a96db82e580e46e24e2b39dd6c5bf7c21.html#a96db82e580e46e24e2b39dd6c5bf7c21">data</a>, <span class="keywordtype">int</span> length, <span class="keywordtype">int</span> <a class="code hl_function" href="classfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">volume</a> = 100, <span class="keywordtype">int</span> durationMS = 0);</div>
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno">  409</span> </div>
<div class="line"><a id="l00431" name="l00431"></a><span class="lineno">  431</span>  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sound_generator_ab9e699f42faf36a58fc0f2ce0b014d39.html#ab9e699f42faf36a58fc0f2ce0b014d39">  432</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_sound_generator_ab9e699f42faf36a58fc0f2ce0b014d39.html#ab9e699f42faf36a58fc0f2ce0b014d39">playSound</a>(T <span class="keyword">const</span> &amp; waveform, <span class="keywordtype">int</span> frequency, <span class="keywordtype">int</span> durationMS, <span class="keywordtype">int</span> <a class="code hl_function" href="classfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">volume</a> = 100) {</div>
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno">  433</span>    <span class="keyword">auto</span> wf = <span class="keyword">new</span> T(waveform);</div>
<div class="line"><a id="l00434" name="l00434"></a><span class="lineno">  434</span>    <a class="code hl_function" href="classfabgl_1_1_sound_generator_a04178c4d1679101843945ecfe8c8d3e1.html#a04178c4d1679101843945ecfe8c8d3e1">attach</a>(wf);</div>
<div class="line"><a id="l00435" name="l00435"></a><span class="lineno">  435</span>    wf-&gt;setFrequency(frequency);</div>
<div class="line"><a id="l00436" name="l00436"></a><span class="lineno">  436</span>    wf-&gt;setVolume(<a class="code hl_function" href="classfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">volume</a>);</div>
<div class="line"><a id="l00437" name="l00437"></a><span class="lineno">  437</span>    wf-&gt;setAutoDestroy(<span class="keyword">true</span>);</div>
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno">  438</span>    wf-&gt;setDuration(m_sampleRate / 1000 * durationMS);</div>
<div class="line"><a id="l00439" name="l00439"></a><span class="lineno">  439</span>    wf-&gt;enable(<span class="keyword">true</span>);</div>
<div class="line"><a id="l00440" name="l00440"></a><span class="lineno">  440</span>    <a class="code hl_function" href="classfabgl_1_1_sound_generator_aa7c56b84cb4738b6826e34ca20993d62.html#aa7c56b84cb4738b6826e34ca20993d62">play</a>(<span class="keyword">true</span>);</div>
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno">  441</span>  }</div>
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno">  442</span> </div>
<div class="line"><a id="l00448" name="l00448"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sound_generator_a88c86d325a9e0c70437469be339f65ee.html#a88c86d325a9e0c70437469be339f65ee">  448</a></span>  <span class="keywordtype">bool</span> <a class="code hl_function" href="classfabgl_1_1_sound_generator_a88c86d325a9e0c70437469be339f65ee.html#a88c86d325a9e0c70437469be339f65ee">playing</a>() { <span class="keywordflow">return</span> m_play; }</div>
<div class="line"><a id="l00449" name="l00449"></a><span class="lineno">  449</span> </div>
<div class="line"><a id="l00450" name="l00450"></a><span class="lineno">  450</span>  <a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> * channels() { <span class="keywordflow">return</span> m_channels; }</div>
<div class="line"><a id="l00451" name="l00451"></a><span class="lineno">  451</span> </div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno">  464</span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_sound_generator_a04178c4d1679101843945ecfe8c8d3e1.html#a04178c4d1679101843945ecfe8c8d3e1">attach</a>(WaveformGenerator * value);</div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno">  465</span> </div>
<div class="line"><a id="l00471" name="l00471"></a><span class="lineno">  471</span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_sound_generator_a15a8d9231086fe5e0cec746e00b87144.html#a15a8d9231086fe5e0cec746e00b87144">detach</a>(WaveformGenerator * value);</div>
<div class="line"><a id="l00472" name="l00472"></a><span class="lineno">  472</span> </div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sound_generator_a77a669d4f95b8abf529a7d3183acb432.html#a77a669d4f95b8abf529a7d3183acb432">  478</a></span>  <span class="keywordtype">void</span> <a class="code hl_function" href="classfabgl_1_1_sound_generator_a77a669d4f95b8abf529a7d3183acb432.html#a77a669d4f95b8abf529a7d3183acb432">setVolume</a>(<span class="keywordtype">int</span> value) { m_volume = value; }</div>
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno">  479</span> </div>
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno"><a class="line" href="classfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">  485</a></span>  <span class="keywordtype">int</span> <a class="code hl_function" href="classfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">volume</a>() { <span class="keywordflow">return</span> m_volume; }</div>
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno">  486</span> </div>
<div class="line"><a id="l00487" name="l00487"></a><span class="lineno">  487</span> </div>
<div class="line"><a id="l00488" name="l00488"></a><span class="lineno">  488</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00489" name="l00489"></a><span class="lineno">  489</span> </div>
<div class="line"><a id="l00490" name="l00490"></a><span class="lineno">  490</span>  <span class="keyword">static</span> <span class="keywordtype">void</span> ISRHandler(<span class="keywordtype">void</span> * arg);     <span class="comment">// used in DAC mode</span></div>
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno">  491</span>  <span class="keyword">static</span> <span class="keywordtype">void</span> timerHandler(<span class="keywordtype">void</span> * args);  <span class="comment">// used in sigma-delta mode</span></div>
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno">  492</span> </div>
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno">  493</span>  <span class="keywordtype">void</span> dac_init();</div>
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno">  494</span>  <span class="keywordtype">void</span> sigmadelta_init();</div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno">  495</span>  <span class="keywordtype">void</span> detachNoSuspend(<a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> * value);</div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno">  496</span>  <span class="keywordtype">void</span> setDMANode(<span class="keywordtype">int</span> index, <span class="keyword">volatile</span> uint16_t * buf, <span class="keywordtype">int</span> len);</div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno">  497</span>  <span class="keywordtype">void</span> init();</div>
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno">  498</span>  </div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno">  499</span>  <span class="keywordtype">int</span> getSample();</div>
<div class="line"><a id="l00500" name="l00500"></a><span class="lineno">  500</span>  </div>
<div class="line"><a id="l00501" name="l00501"></a><span class="lineno">  501</span><span class="preprocessor">  #ifdef FABGL_EMULATED</span></div>
<div class="line"><a id="l00502" name="l00502"></a><span class="lineno">  502</span>  <span class="keywordtype">void</span> sdl_init();</div>
<div class="line"><a id="l00503" name="l00503"></a><span class="lineno">  503</span>  <span class="keyword">static</span> <span class="keywordtype">void</span> SDLAudioCallback(<span class="keywordtype">void</span> * <a class="code hl_variable" href="displaycontroller_8h_a96db82e580e46e24e2b39dd6c5bf7c21.html#a96db82e580e46e24e2b39dd6c5bf7c21">data</a>, Uint8 * buffer, <span class="keywordtype">int</span> length);</div>
<div class="line"><a id="l00504" name="l00504"></a><span class="lineno">  504</span><span class="preprocessor">  #endif</span></div>
<div class="line"><a id="l00505" name="l00505"></a><span class="lineno">  505</span> </div>
<div class="line"><a id="l00506" name="l00506"></a><span class="lineno">  506</span> </div>
<div class="line"><a id="l00507" name="l00507"></a><span class="lineno">  507</span>  <a class="code hl_class" href="classfabgl_1_1_waveform_generator.html">WaveformGenerator</a> * m_channels;</div>
<div class="line"><a id="l00508" name="l00508"></a><span class="lineno">  508</span> </div>
<div class="line"><a id="l00509" name="l00509"></a><span class="lineno">  509</span>  uint16_t *          m_sampleBuffer[2];</div>
<div class="line"><a id="l00510" name="l00510"></a><span class="lineno">  510</span> </div>
<div class="line"><a id="l00511" name="l00511"></a><span class="lineno">  511</span>  int8_t              m_volume;</div>
<div class="line"><a id="l00512" name="l00512"></a><span class="lineno">  512</span> </div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno">  513</span>  uint16_t            m_sampleRate;</div>
<div class="line"><a id="l00514" name="l00514"></a><span class="lineno">  514</span> </div>
<div class="line"><a id="l00515" name="l00515"></a><span class="lineno">  515</span>  <span class="keywordtype">bool</span>                m_play;</div>
<div class="line"><a id="l00516" name="l00516"></a><span class="lineno">  516</span>  </div>
<div class="line"><a id="l00517" name="l00517"></a><span class="lineno">  517</span>  gpio_num_t          m_gpio;</div>
<div class="line"><a id="l00518" name="l00518"></a><span class="lineno">  518</span>  </div>
<div class="line"><a id="l00519" name="l00519"></a><span class="lineno">  519</span>  intr_handle_t       m_isr_handle;</div>
<div class="line"><a id="l00520" name="l00520"></a><span class="lineno">  520</span>  </div>
<div class="line"><a id="l00521" name="l00521"></a><span class="lineno">  521</span>  lldesc_t <span class="keyword">volatile</span> * m_DMAChain;</div>
<div class="line"><a id="l00522" name="l00522"></a><span class="lineno">  522</span>  </div>
<div class="line"><a id="l00523" name="l00523"></a><span class="lineno">  523</span>  <a class="code hl_enumeration" href="group___enumerations_ga0c57da098cf653e49e8c46e3a86eee31.html#ga0c57da098cf653e49e8c46e3a86eee31">SoundGenMethod</a>      m_genMethod;</div>
<div class="line"><a id="l00524" name="l00524"></a><span class="lineno">  524</span>  </div>
<div class="line"><a id="l00525" name="l00525"></a><span class="lineno">  525</span>  <span class="keywordtype">bool</span>                m_initDone;</div>
<div class="line"><a id="l00526" name="l00526"></a><span class="lineno">  526</span>  </div>
<div class="line"><a id="l00527" name="l00527"></a><span class="lineno">  527</span>  esp_timer_handle_t  m_timerHandle;</div>
<div class="line"><a id="l00528" name="l00528"></a><span class="lineno">  528</span>  </div>
<div class="line"><a id="l00529" name="l00529"></a><span class="lineno">  529</span><span class="preprocessor">  #ifdef FABGL_EMULATED</span></div>
<div class="line"><a id="l00530" name="l00530"></a><span class="lineno">  530</span>  SDL_AudioDeviceID   m_device;</div>
<div class="line"><a id="l00531" name="l00531"></a><span class="lineno">  531</span><span class="preprocessor">  #endif</span></div>
<div class="line"><a id="l00532" name="l00532"></a><span class="lineno">  532</span> </div>
<div class="line"><a id="l00533" name="l00533"></a><span class="lineno">  533</span>};</div>
<div class="line"><a id="l00534" name="l00534"></a><span class="lineno">  534</span> </div>
<div class="line"><a id="l00535" name="l00535"></a><span class="lineno">  535</span> </div>
<div class="line"><a id="l00536" name="l00536"></a><span class="lineno">  536</span> </div>
<div class="line"><a id="l00537" name="l00537"></a><span class="lineno">  537</span> </div>
<div class="line"><a id="l00538" name="l00538"></a><span class="lineno">  538</span>} <span class="comment">// end of namespace</span></div>
<div class="line"><a id="l00539" name="l00539"></a><span class="lineno">  539</span> </div>
<div class="ttc" id="aclassfabgl_1_1_noise_waveform_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_noise_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::NoiseWaveformGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00308">soundgen.cpp:308</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_noise_waveform_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_noise_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::NoiseWaveformGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00303">soundgen.cpp:303</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_noise_waveform_generator_html"><div class="ttname"><a href="classfabgl_1_1_noise_waveform_generator.html">fabgl::NoiseWaveformGenerator</a></div><div class="ttdoc">Noise generator.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00262">soundgen.h:262</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_samples_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_samples_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::SamplesGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00425">soundgen.cpp:425</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_samples_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_samples_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::SamplesGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00420">soundgen.cpp:420</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_samples_generator_html"><div class="ttname"><a href="classfabgl_1_1_samples_generator.html">fabgl::SamplesGenerator</a></div><div class="ttdoc">Samples generator.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00311">soundgen.h:311</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sawtooth_waveform_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_sawtooth_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::SawtoothWaveformGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00262">soundgen.cpp:262</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sawtooth_waveform_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_sawtooth_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::SawtoothWaveformGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00254">soundgen.cpp:254</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sawtooth_waveform_generator_html"><div class="ttname"><a href="classfabgl_1_1_sawtooth_waveform_generator.html">fabgl::SawtoothWaveformGenerator</a></div><div class="ttdoc">Sawtooth waveform generator.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00245">soundgen.h:245</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sine_waveform_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_sine_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::SineWaveformGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00097">soundgen.cpp:97</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sine_waveform_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_sine_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::SineWaveformGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00089">soundgen.cpp:89</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sine_waveform_generator_html"><div class="ttname"><a href="classfabgl_1_1_sine_waveform_generator.html">fabgl::SineWaveformGenerator</a></div><div class="ttdoc">Sine waveform generator.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00186">soundgen.h:186</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sound_generator_a04178c4d1679101843945ecfe8c8d3e1_html_a04178c4d1679101843945ecfe8c8d3e1"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a04178c4d1679101843945ecfe8c8d3e1.html#a04178c4d1679101843945ecfe8c8d3e1">fabgl::SoundGenerator::attach</a></div><div class="ttdeci">void attach(WaveformGenerator *value)</div><div class="ttdoc">Attaches a waveform generator.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00686">soundgen.cpp:686</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sound_generator_a15a8d9231086fe5e0cec746e00b87144_html_a15a8d9231086fe5e0cec746e00b87144"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a15a8d9231086fe5e0cec746e00b87144.html#a15a8d9231086fe5e0cec746e00b87144">fabgl::SoundGenerator::detach</a></div><div class="ttdeci">void detach(WaveformGenerator *value)</div><div class="ttdoc">Detaches a waveform generator.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00699">soundgen.cpp:699</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sound_generator_a1f313ace9bd328af72dac21f508f7b25_html_a1f313ace9bd328af72dac21f508f7b25"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a1f313ace9bd328af72dac21f508f7b25.html#a1f313ace9bd328af72dac21f508f7b25">fabgl::SoundGenerator::SoundGenerator</a></div><div class="ttdeci">SoundGenerator(int sampleRate=16384, gpio_num_t gpio=GPIO_AUTO, SoundGenMethod genMethod=SoundGenMethod::Auto)</div><div class="ttdoc">Creates an instance of the sound generator. Only one instance is allowed.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00454">soundgen.cpp:454</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2_html_a56fd55a21e8060769938c33ac16ee4f2"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">fabgl::SoundGenerator::volume</a></div><div class="ttdeci">int volume()</div><div class="ttdoc">Determines current overall volume.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00485">soundgen.h:485</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sound_generator_a77a669d4f95b8abf529a7d3183acb432_html_a77a669d4f95b8abf529a7d3183acb432"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a77a669d4f95b8abf529a7d3183acb432.html#a77a669d4f95b8abf529a7d3183acb432">fabgl::SoundGenerator::setVolume</a></div><div class="ttdeci">void setVolume(int value)</div><div class="ttdoc">Sets the overall volume.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00478">soundgen.h:478</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sound_generator_a7ba0033bdfb41d5d58fc63a160f311f6_html_a7ba0033bdfb41d5d58fc63a160f311f6"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a7ba0033bdfb41d5d58fc63a160f311f6.html#a7ba0033bdfb41d5d58fc63a160f311f6">fabgl::SoundGenerator::playSamples</a></div><div class="ttdeci">SamplesGenerator * playSamples(int8_t const *data, int length, int volume=100, int durationMS=0)</div><div class="ttdoc">Plays the specified samples.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00671">soundgen.cpp:671</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sound_generator_a88c86d325a9e0c70437469be339f65ee_html_a88c86d325a9e0c70437469be339f65ee"><div class="ttname"><a href="classfabgl_1_1_sound_generator_a88c86d325a9e0c70437469be339f65ee.html#a88c86d325a9e0c70437469be339f65ee">fabgl::SoundGenerator::playing</a></div><div class="ttdeci">bool playing()</div><div class="ttdoc">Determines whether sound generator is playing.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00448">soundgen.h:448</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sound_generator_aa7c56b84cb4738b6826e34ca20993d62_html_aa7c56b84cb4738b6826e34ca20993d62"><div class="ttname"><a href="classfabgl_1_1_sound_generator_aa7c56b84cb4738b6826e34ca20993d62.html#aa7c56b84cb4738b6826e34ca20993d62">fabgl::SoundGenerator::play</a></div><div class="ttdeci">bool play(bool value)</div><div class="ttdoc">Starts or stops playing.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00646">soundgen.cpp:646</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sound_generator_ab9e699f42faf36a58fc0f2ce0b014d39_html_ab9e699f42faf36a58fc0f2ce0b014d39"><div class="ttname"><a href="classfabgl_1_1_sound_generator_ab9e699f42faf36a58fc0f2ce0b014d39.html#ab9e699f42faf36a58fc0f2ce0b014d39">fabgl::SoundGenerator::playSound</a></div><div class="ttdeci">void playSound(T const &amp;waveform, int frequency, int durationMS, int volume=100)</div><div class="ttdoc">Plays the specified waveform.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00432">soundgen.h:432</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sound_generator_ac8bb3912a3ce86b15842e79d0b421204_html_ac8bb3912a3ce86b15842e79d0b421204"><div class="ttname"><a href="classfabgl_1_1_sound_generator_ac8bb3912a3ce86b15842e79d0b421204.html#ac8bb3912a3ce86b15842e79d0b421204">fabgl::SoundGenerator::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdoc">Stops playing and removes all attached waveform generators.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00497">soundgen.cpp:497</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_sound_generator_html"><div class="ttname"><a href="classfabgl_1_1_sound_generator.html">fabgl::SoundGenerator</a></div><div class="ttdoc">SoundGenerator handles audio output.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00351">soundgen.h:351</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_square_waveform_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_square_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::SquareWaveformGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00159">soundgen.cpp:159</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_square_waveform_generator_a5719e6bf55f3f485e6b82e7800acf004_html_a5719e6bf55f3f485e6b82e7800acf004"><div class="ttname"><a href="classfabgl_1_1_square_waveform_generator_a5719e6bf55f3f485e6b82e7800acf004.html#a5719e6bf55f3f485e6b82e7800acf004">fabgl::SquareWaveformGenerator::setDutyCycle</a></div><div class="ttdeci">void setDutyCycle(int dutyCycle)</div><div class="ttdoc">Sets square wave duty cycle.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00153">soundgen.cpp:153</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_square_waveform_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_square_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::SquareWaveformGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00144">soundgen.cpp:144</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_square_waveform_generator_html"><div class="ttname"><a href="classfabgl_1_1_square_waveform_generator.html">fabgl::SquareWaveformGenerator</a></div><div class="ttdoc">Square waveform generator.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00203">soundgen.h:203</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_triangle_waveform_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_triangle_waveform_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::TriangleWaveformGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00210">soundgen.cpp:210</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_triangle_waveform_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_triangle_waveform_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::TriangleWaveformGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00202">soundgen.cpp:202</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_triangle_waveform_generator_html"><div class="ttname"><a href="classfabgl_1_1_triangle_waveform_generator.html">fabgl::TriangleWaveformGenerator</a></div><div class="ttdoc">Triangle waveform generator.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00228">soundgen.h:228</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_v_i_c_noise_generator_a52c1060c5ab1219386569f2cc39991b9_html_a52c1060c5ab1219386569f2cc39991b9"><div class="ttname"><a href="classfabgl_1_1_v_i_c_noise_generator_a52c1060c5ab1219386569f2cc39991b9.html#a52c1060c5ab1219386569f2cc39991b9">fabgl::VICNoiseGenerator::getSample</a></div><div class="ttdeci">int getSample()</div><div class="ttdoc">Gets next sample.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00358">soundgen.cpp:358</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_v_i_c_noise_generator_a5b5c30c147988a4bef2b08394984079d_html_a5b5c30c147988a4bef2b08394984079d"><div class="ttname"><a href="classfabgl_1_1_v_i_c_noise_generator_a5b5c30c147988a4bef2b08394984079d.html#a5b5c30c147988a4bef2b08394984079d">fabgl::VICNoiseGenerator::setFrequency</a></div><div class="ttdeci">void setFrequency(int value)</div><div class="ttdoc">Sets output frequency.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8cpp_source.html#l00347">soundgen.cpp:347</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_v_i_c_noise_generator_html"><div class="ttname"><a href="classfabgl_1_1_v_i_c_noise_generator.html">fabgl::VICNoiseGenerator</a></div><div class="ttdoc">Emulates VIC6561 (VIC20) noise generator.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00284">soundgen.h:284</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_waveform_generator_a2670d55a6f6725717133799223effc61_html_a2670d55a6f6725717133799223effc61"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a2670d55a6f6725717133799223effc61.html#a2670d55a6f6725717133799223effc61">fabgl::WaveformGenerator::setAutoDestroy</a></div><div class="ttdeci">void setAutoDestroy(bool value)</div><div class="ttdoc">Sets autodestroy mode.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00112">soundgen.h:112</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_waveform_generator_a4d003299b7939c5c2a6fd8cee4fe7504_html_a4d003299b7939c5c2a6fd8cee4fe7504"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a4d003299b7939c5c2a6fd8cee4fe7504.html#a4d003299b7939c5c2a6fd8cee4fe7504">fabgl::WaveformGenerator::enable</a></div><div class="ttdeci">void enable(bool value)</div><div class="ttdoc">Enables or disabled this generator.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00151">soundgen.h:151</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_waveform_generator_a56fd55a21e8060769938c33ac16ee4f2_html_a56fd55a21e8060769938c33ac16ee4f2"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a56fd55a21e8060769938c33ac16ee4f2.html#a56fd55a21e8060769938c33ac16ee4f2">fabgl::WaveformGenerator::volume</a></div><div class="ttdeci">int volume()</div><div class="ttdoc">Determines current volume.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00135">soundgen.h:135</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_waveform_generator_a6d3ded07c8e0000d3f20c12ed801db7b_html_a6d3ded07c8e0000d3f20c12ed801db7b"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a6d3ded07c8e0000d3f20c12ed801db7b.html#a6d3ded07c8e0000d3f20c12ed801db7b">fabgl::WaveformGenerator::setFrequency</a></div><div class="ttdeci">virtual void setFrequency(int value)=0</div><div class="ttdoc">Sets output frequency.</div></div>
<div class="ttc" id="aclassfabgl_1_1_waveform_generator_a77a669d4f95b8abf529a7d3183acb432_html_a77a669d4f95b8abf529a7d3183acb432"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a77a669d4f95b8abf529a7d3183acb432.html#a77a669d4f95b8abf529a7d3183acb432">fabgl::WaveformGenerator::setVolume</a></div><div class="ttdeci">void setVolume(int value)</div><div class="ttdoc">Sets volume of this generator.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00128">soundgen.h:128</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_waveform_generator_a85fa2eb2cf3e487be53c8b2625bdce69_html_a85fa2eb2cf3e487be53c8b2625bdce69"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a85fa2eb2cf3e487be53c8b2625bdce69.html#a85fa2eb2cf3e487be53c8b2625bdce69">fabgl::WaveformGenerator::setSampleRate</a></div><div class="ttdeci">void setSampleRate(int value)</div><div class="ttdoc">Sets the sample rate.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00160">soundgen.h:160</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_waveform_generator_a996f2f6c960641738fc46d3f39f6ef6f_html_a996f2f6c960641738fc46d3f39f6ef6f"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_a996f2f6c960641738fc46d3f39f6ef6f.html#a996f2f6c960641738fc46d3f39f6ef6f">fabgl::WaveformGenerator::duration</a></div><div class="ttdeci">uint32_t duration()</div><div class="ttdoc">Returns number of remaining samples to play.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00096">soundgen.h:96</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_waveform_generator_aae62a0a75472fde81f63cd0f9d9288c2_html_aae62a0a75472fde81f63cd0f9d9288c2"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_aae62a0a75472fde81f63cd0f9d9288c2.html#aae62a0a75472fde81f63cd0f9d9288c2">fabgl::WaveformGenerator::setDuration</a></div><div class="ttdeci">void setDuration(uint32_t value)</div><div class="ttdoc">Sets number of samples to play.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00089">soundgen.h:89</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_waveform_generator_abc395029362d9990b5dad44dfafe9d63_html_abc395029362d9990b5dad44dfafe9d63"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_abc395029362d9990b5dad44dfafe9d63.html#abc395029362d9990b5dad44dfafe9d63">fabgl::WaveformGenerator::sampleRate</a></div><div class="ttdeci">uint16_t sampleRate()</div><div class="ttdoc">Determines the sample rate.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00167">soundgen.h:167</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_waveform_generator_acafb7271189f6d844921794d61cd608a_html_acafb7271189f6d844921794d61cd608a"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_acafb7271189f6d844921794d61cd608a.html#acafb7271189f6d844921794d61cd608a">fabgl::WaveformGenerator::enabled</a></div><div class="ttdeci">bool enabled()</div><div class="ttdoc">Determines whether this generator is enabled or disabled.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00142">soundgen.h:142</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_waveform_generator_ace43e846a26854aa34091e3eabd07f24_html_ace43e846a26854aa34091e3eabd07f24"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_ace43e846a26854aa34091e3eabd07f24.html#ace43e846a26854aa34091e3eabd07f24">fabgl::WaveformGenerator::setAutoDetach</a></div><div class="ttdeci">void setAutoDetach(bool value)</div><div class="ttdoc">Sets autodetach mode.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00103">soundgen.h:103</a></div></div>
<div class="ttc" id="aclassfabgl_1_1_waveform_generator_af6efc18f13f1cd2aeb2fb810b103b356_html_af6efc18f13f1cd2aeb2fb810b103b356"><div class="ttname"><a href="classfabgl_1_1_waveform_generator_af6efc18f13f1cd2aeb2fb810b103b356.html#af6efc18f13f1cd2aeb2fb810b103b356">fabgl::WaveformGenerator::getSample</a></div><div class="ttdeci">virtual int getSample()=0</div><div class="ttdoc">Gets next sample.</div></div>
<div class="ttc" id="aclassfabgl_1_1_waveform_generator_html"><div class="ttname"><a href="classfabgl_1_1_waveform_generator.html">fabgl::WaveformGenerator</a></div><div class="ttdoc">Base abstract class for waveform generators. A waveform generator can be seen as an audio channel tha...</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00071">soundgen.h:71</a></div></div>
<div class="ttc" id="adisplaycontroller_8h_a96db82e580e46e24e2b39dd6c5bf7c21_html_a96db82e580e46e24e2b39dd6c5bf7c21"><div class="ttname"><a href="displaycontroller_8h_a96db82e580e46e24e2b39dd6c5bf7c21.html#a96db82e580e46e24e2b39dd6c5bf7c21">data</a></div><div class="ttdeci">uint8_t const  * data</div><div class="ttdef"><b>Definition:</b> <a href="displaycontroller_8h_source.html#l00004">displaycontroller.h:4</a></div></div>
<div class="ttc" id="afabglconf_8h_html"><div class="ttname"><a href="fabglconf_8h.html">fabglconf.h</a></div><div class="ttdoc">This file contains FabGL library configuration settings, like number of supported colors,...</div></div>
<div class="ttc" id="afabutils_8h_html"><div class="ttname"><a href="fabutils_8h.html">fabutils.h</a></div><div class="ttdoc">This file contains some utility classes and functions.</div></div>
<div class="ttc" id="agroup___enumerations_ga0c57da098cf653e49e8c46e3a86eee31_html_ga0c57da098cf653e49e8c46e3a86eee31"><div class="ttname"><a href="group___enumerations_ga0c57da098cf653e49e8c46e3a86eee31.html#ga0c57da098cf653e49e8c46e3a86eee31">fabgl::SoundGenMethod</a></div><div class="ttdeci">SoundGenMethod</div><div class="ttdoc">Specifies sound generation method.</div><div class="ttdef"><b>Definition:</b> <a href="soundgen_8h_source.html#l00329">soundgen.h:329</a></div></div>
<div class="ttc" id="agroup___enumerations_ga0c57da098cf653e49e8c46e3a86eee31_html_gga0c57da098cf653e49e8c46e3a86eee31a06b9281e396db002010bde1de57262eb"><div class="ttname"><a href="group___enumerations_ga0c57da098cf653e49e8c46e3a86eee31.html#gga0c57da098cf653e49e8c46e3a86eee31a06b9281e396db002010bde1de57262eb">fabgl::SoundGenMethod::Auto</a></div><div class="ttdeci">@ Auto</div></div>
<div class="ttc" id="agroup___enumerations_ga0c57da098cf653e49e8c46e3a86eee31_html_gga0c57da098cf653e49e8c46e3a86eee31a52a8b954485e8bf8ebe32865d17563a6"><div class="ttname"><a href="group___enumerations_ga0c57da098cf653e49e8c46e3a86eee31.html#gga0c57da098cf653e49e8c46e3a86eee31a52a8b954485e8bf8ebe32865d17563a6">fabgl::SoundGenMethod::DAC</a></div><div class="ttdeci">@ DAC</div></div>
<div class="ttc" id="agroup___enumerations_ga0c57da098cf653e49e8c46e3a86eee31_html_gga0c57da098cf653e49e8c46e3a86eee31a582cc73bac6fd333fd602b6a3db1dfd4"><div class="ttname"><a href="group___enumerations_ga0c57da098cf653e49e8c46e3a86eee31.html#gga0c57da098cf653e49e8c46e3a86eee31a582cc73bac6fd333fd602b6a3db1dfd4">fabgl::SoundGenMethod::SigmaDelta</a></div><div class="ttdeci">@ SigmaDelta</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_82e8a5453e51b0b6168db3257bd0eaab.html">devdrivers</a></li><li class="navelem"><a class="el" href="soundgen_8h.html">soundgen.h</a></li>
    <li class="footer">Generated on Mon Aug 29 2022 13:52:04 for FabGL by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
  </ul>
</div>
</body>
</html>
